package com.pds.web.monitor.controller;

import com.pds.common.annotation.Log;
import com.pds.common.core.controller.BaseController;
import com.pds.common.core.domain.R;
import com.pds.common.enums.BusinessType;
import com.pds.web.monitor.domain.PdsMonitorTaskSampling;
import com.pds.web.monitor.service.IPdsMonitorTaskSamplingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/monitorTaskSampling")
public class PdsMonitorTaskSamplingController extends BaseController {

    @Autowired
    private IPdsMonitorTaskSamplingService pdsMonitorTaskSamplingService;

    /**
     * 更新
     *
     * @param pdsMonitorTaskSampling
     * @return
     */
//    @Log(title = "监测任务更新采样", businessType = BusinessType.UPDATE)
    @PutMapping("/update")
    public R<Boolean> updateSampling(@RequestBody PdsMonitorTaskSampling pdsMonitorTaskSampling) {
        return R.ok(pdsMonitorTaskSamplingService.update(pdsMonitorTaskSampling));
    }

    /**
     * 查询
     *
     * @param pdsMonitorTaskSampling
     * @return
     */
    @GetMapping("/select")
    public R<PdsMonitorTaskSampling> selectSampling(PdsMonitorTaskSampling pdsMonitorTaskSampling) {
        return R.ok(pdsMonitorTaskSamplingService.selectSampling(pdsMonitorTaskSampling));
    }
}
